package cn.myjerry.others.three;

import java.util.IdentityHashMap;

/**
 * IdentityHashMap 键比较地址去重
 * @author Jerry
 *
 */
public class IdentityHashMapDemo {
	public static void main(String[] args) {
		IdentityHashMap<String, String> map = new IdentityHashMap<String, String>();
		//常量池中的a
		map.put("a", "a");
		map.put("a", "a1");
		System.out.println(map.size());
		map.put(new String("a"), "a2");
		map.put(new String("a"), "a3");
		System.out.println(map.size());
	}
}
